package com.example.shardingsphere.mapper;

import com.example.shardingsphere.entity.Order;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * ^_^ ^_^
 *
 * @author wuquan
 * @date 2021/11/04
 */
@Mapper
public interface OrderMapper {


    /*
    id已配置用 雪花算法生成
     */
    @Insert("insert into t_order values( #{userId}, #{customerId})")
    public void insert(Order order);


    @Select("select * from t_order")
    @Results({
            @Result(column = "id", property = "id"),
            @Result(column = "user_id", property = "userId"),
            @Result(column = "customer_id", property = "customerId")
    })
    List<Order> select();

}
